<template>
  <div>{{ name }}</div>
  <div>num:{{ num }}</div>
  <h1>下面是传递到的孙子组件</h1>
  <MyFather />
</template>

<script setup>
import MyFather from './MyFather-MySon/MyFather.vue'
import { provide, ref } from 'vue'
const name = ref('张三')
provide('name', name)
const num = ref(0)
const changeNum = () => {
  num.value++
}
provide('changeNum', changeNum)
provide('num', num)
</script>

<style lang="scss" scoped></style>
